package top.yxf.gulimall.product.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @ClassName MybatisConfig
 * @Description TODO
 * @Author zw
 * @Date 2021/10/27 下午9:01
 * @Version 1.0
 */
@Configuration
@EnableTransactionManagement
@MapperScan("top.yxf.gulimall.product.dao")
public class MybatisConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setLimit(1000L);
        paginationInterceptor.setOverflow(true);
        return paginationInterceptor;
    }

}
